#include <string>
#include <algorithm>
using namespace std;
/*
 * @lc app=leetcode.cn id=60 lang=cpp
 *
 * [60] 排列序列
 */

// @lc code=start
class Solution {
public:
    string getPermutation(int n, int k) {
        string x;
        for (int i = 1; i <= n; i++) x.push_back(i + '0');
        for (int i = 1; i < k; i++)
            next_permutation(x.begin(), x.end());
        return x;
    }
};
// @lc code=end

